import yagmail,logging
import time
class Tools():
    def log(self):
        t = time.strftime('%Y%m%d_%H%M%S', time.localtime())
        log = logging.basicConfig(level=logging.DEBUG
                                  ,filemode='a+'
                                  ,format='%(message)s %(funcName)s %(thread)d  %(levelname)s %(filename)s %(asctime)s'
                                  ,filename='a3mall.log')
        return log

    def email(self):
        em = yagmail.SMTP(user='zzh2834326498@qq.com',password='rbtbgahnvdwaddbf',host='smtp.qq.com')
        em.send(to='zzh2834326498@qq.com',subject=time.strftime('%Y-%m-%d  %H:%M:%S',time.localtime())+'百度webui自动化测试报告',contents=r'D:\gaosi_xm\PythonProject11\week3\run\html\index.html')